Skip to content

Fix #6060: Don't insert apply or implicits on constructor calls #6102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 18, 2019

This mirrors scalac's behavior.

@smarter
Copy link
Member

smarter commented Mar 18, 2019

Hmm, wouldn't it be better to not generate these trees in the first place, perhaps by turning off apply/implicit insertion when the InSuperCall mode is set ?

@odersky
Copy link
Contributor Author

odersky commented Mar 18, 2019

Hmm, wouldn't it be better to not generate these trees in the first place, perhaps by turning off apply/implicit insertion when the InSuperCall mode is set ?

That's not so easy. InSuperCall mode is also set for the arguments of constructor calls, where inserting apply is OK. In fact I tried something like this first, but it turned out to be harder than I thought. The current scheme is better since it does not insert yet another condition into an already difficult branching structure.

@odersky odersky merged commit 5eca323 into scala:master Mar 19, 2019
@allanrenucci allanrenucci deleted the fix-#6060 branch March 19, 2019 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants